import json
import os.path


class OperationJson:

    @staticmethod
    def read_json(filepath):
        with open(filepath, mode='r', encoding='utf-8') as f:#打开文件
            json_data = json.load(f)#读取文件
        return json_data




if __name__ == '__main__':
    #相对路径
    # print(OperationJson.build_json('../test_data/login_data.json'))
    # 绝对路径

    file_path=(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'test_data', 'login_data.json'))
    print(OperationJson.read_json(file_path))

